/**
 * Licensee: Universidad de La Frontera
 * License Type: Academic
 */
package ormsamples;

import org.orm.*;
public class CreateTrabajo3pdsData {
	public void createTestData() throws PersistentException {
		PersistentTransaction t = orm.Trabajo3pdsPersistentManager.instance().getSession().beginTransaction();
		try {
			orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
			orm.dao.AdministracionDAO lormAdministracionDAO = lDAOFactory.getAdministracionDAO();
			orm.Administracion lormAdministracion = lormAdministracionDAO.createAdministracion();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : cliente
			lormAdministracionDAO.save(lormAdministracion);
			orm.dao.ClienteDAO lormClienteDAO = lDAOFactory.getClienteDAO();
			orm.Cliente lormCliente = lormClienteDAO.createCliente();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : id_admin
			lormClienteDAO.save(lormCliente);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			CreateTrabajo3pdsData createTrabajo3pdsData = new CreateTrabajo3pdsData();
			try {
				createTrabajo3pdsData.createTestData();
			}
			finally {
				orm.Trabajo3pdsPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
